//
//  AddressUtils.m
//  CarTown
//
//  Created by xionghao on 15/9/2.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "AddressUtils.h"
#import "Address.h"
@implementation AddressUtils
+(void)getAddress:(void (^)(bool isok))su{
   NSArray *array= [Address getPro];
    if (array.count>21) {
        if (su) {
            su(YES);
        }
        return;
    }else{
        NSMutableDictionary *params=[NSMutableDictionary dictionary];
        params[@"action"]=@"select";
        
        [PostUitls Post:cityurl parameters:params success:^(id response) {
                   NSArray *adds=response;
           
          
            [Address addressWithDict:adds];
                if (su) {
                    su(YES);
                }
                 NSLog(@"初始化成功");
            
            
        } failure:^(NSError *error) {
            NSLog(@"初始化失败");
            if (su) {
                su(NO);
            }
        }];
    }
}
@end
